Conversation
Fear the all-mighty gummy bear!!!
Intro to circuit design
My Reflection
SeunginLyu
left a comment
There was a problem hiding this comment.
Looks good overall! I've made some comments that might help you stylize your code a little better.
| import random | ||
| from PIL import Image | ||
| import math | ||
| pi = 3.14 |
There was a problem hiding this comment.
It's a stylistic convention to use all caps for constants. PI=3.14
| from PIL import Image | ||
| import math | ||
| pi = 3.14 | ||
| def prod(a,b): #Returns the product of two values |
|
|
||
|
|
||
|
|
||
| # prod = ['prod',build_random_function(depth-1, depth-1),build_random_function(depth-1, depth-1)] |
There was a problem hiding this comment.
please remove comments for final code submission.
| # return "Error" | ||
| #TODO: implement this | ||
| #print (f) | ||
| e = evaluate_random_function #dummy function to make the code take up less room |
There was a problem hiding this comment.
i think it's actually more readable to use the full function name in this case.
| """ | ||
|
|
||
| difference = val-input_interval_start | ||
| difference = difference/ (input_interval_end - input_interval_start) |
There was a problem hiding this comment.
simple syntax : difference += input_interval_end - input_interval_start)
| red_function = build_random_function(9, 15) | ||
| green_function = build_random_function(9, 15) | ||
| blue_function = build_random_function(9, 15) | ||
| x = random.uniform(0, 1) |
There was a problem hiding this comment.
what is this line of code doing? Perhaps add an inline comment explaining why you added this line of code.
| @@ -43,7 +110,47 @@ def evaluate_random_function(f, x, y): | |||
| >>> evaluate_random_function(["y"],0.1,0.02) | |||
| 0.02 | |||
There was a problem hiding this comment.
I recommend that you add more unit tests of your own in future projects.
Turning in my project.